package com.huaxin.device.mapping;

import com.huaxin.device.dto.request.DeviceAlarmConfigCreateReqDTO;
import com.huaxin.device.dto.request.DeviceAlarmConfigUpdateReqDTO;
import com.huaxin.device.models.DeviceAlarmConfig;
import org.mapstruct.AfterMapping;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;

@Mapper(componentModel = "spring")
public interface DeviceAlarmConfigMapping {

    DeviceAlarmConfig toEntity(DeviceAlarmConfigCreateReqDTO in);

    @AfterMapping
    default void afterMapping(DeviceAlarmConfigCreateReqDTO in, @MappingTarget DeviceAlarmConfig entity) {
    }

    void updateEntity(DeviceAlarmConfigUpdateReqDTO in, @MappingTarget DeviceAlarmConfig entity);
}